<template>
    <aside class="asideStyle">
        <el-row >
            <el-row :span="2">
                <el-button type="primary" icon="el-icon-search" size="mini" @click="dialogFormVisible = true">搜索</el-button>
            </el-row>
        </el-row>
        <el-dialog title="收货地址" :visible.sync="dialogFormVisible">
            <el-form :model="form">
                <el-form-item label="订单状态" :label-width="formLabelWidth">
                    <el-select v-model="form.status" placeholder="请选择活动区域">
                        <el-option label="待发货" value="1"></el-option>
                        <el-option label="已发货" value="2"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="供货商列表" :label-width="formLabelWidth" v-if="$store.state.system_type=='1'">
                    <el-select v-model="form.supplier" placeholder="请选择活动区域">
                        <el-option
                                v-for="(item, index) in supplierList"
                                :key="index"
                                :label="item.supplier_name" :value="item.id"></el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false">取 消</el-button>
                <el-button type="primary" @click="searchBtn">确 定</el-button>
            </div>
        </el-dialog>
    </aside>
</template>

<script>
    export default {
        name: "order-btn.vue",
        data() {
            return {
                dialogFormVisible: false,
                formLabelWidth: '100px',
                form: {
                    status: '',
                    supplier: ''
                },
                supplierList: []
            }

        },
        created() {
            this.getSuppliers()
        },
        methods: {
            searchBtn() {
                console.log(this.form);
                this.$emit('reloadFun', this.form)
                this.dialogFormVisible = false;
            },
            async getSuppliers() {
                const data = await this.$Http.getSupplier();
                console.log(data);
                this.supplierList = data.list
            }
        }
    }
</script>

<style scoped>

</style>
